package com.zoweunion.mechanic.controller;

import com.zoweunion.mechanic.model.ResponseBean;
import com.zoweunion.mechanic.util.MyException;
import com.zoweunion.mechanic.util.constants.Constants;
import com.zoweunion.mechanic.util.task.CarDataAbnormalTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@RestController
@RequestMapping("/test/testm")
public class TestMessages extends BaseController {


    @Autowired
    private CarDataAbnormalTask carDataAbnormalTask;

    @GetMapping("sendtestm")
    public ResponseBean sendtestm() throws MyException {
        int count=0;
        String fmiDescription="这是一条测试的消息";
        String userId="efd6edc8d05f4f03b0f93f6b1c8fe3fc";
        Map<String, Object> item=new HashMap<>();
        item.put("s_id","be7bf99ac18a42bdb1f534c85497e227");
        item.put("advice_name","TEST100");
        carDataAbnormalTask.jPushFmiDescription(item, userId, fmiDescription, count + 1);
        return new ResponseBean(Constants.CODE_SUCCESS, "发送成功", null);
    }
}
